package com.zjdiepu.www.biz.system;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zjdiepu.www.base.core.BaseService;
import com.zjdiepu.www.dao.system.DpSuggestionBoxMapper;
import com.zjdiepu.www.ibiz.system.IDpSuggestionBoxService;
import com.zjdiepu.www.model.system.dto.DpSuggestionBox;
@Service
public class DpSuggestionBoxServiceImpl  extends BaseService implements IDpSuggestionBoxService{
	
	public static final Logger logger = LoggerFactory.getLogger(DpSuggestionBoxServiceImpl.class);

	@Autowired
	private DpSuggestionBoxMapper suggestionBoxMapper;

	/* 
	* @author zhangzj
	* <p>Title: queryByPage</p> 
	* <p>Description: </p> 
	* @param page
	* @param rows
	* @return 
	* @see com.api.base.service.ISuggestionBoxService#queryByPage(java.lang.Integer, java.lang.Integer) 
	* @version V1.0
	*/
	@Override
	public PageInfo<DpSuggestionBox> queryByPage(Integer pageNo, Integer pageSize,Map<String, Object> aWhere) {
		pageNo = pageNo == null?1:pageNo;
		pageSize = pageSize == null?10:pageSize;
		PageHelper.startPage(pageNo, pageSize);
		List<DpSuggestionBox> list=suggestionBoxMapper.queryByPage(aWhere);
		PageInfo<DpSuggestionBox> page = new PageInfo<DpSuggestionBox>(list);
		return page;
	}

	/* 
	* @author zhangzj
	* <p>Title: insert</p> 
	* <p>Description: </p> 
	* @param box 
	* @see com.api.base.service.ISuggestionBoxService#insert(DpSuggestionBox)
	* @version V1.0
	*/
	@Override
	public void insert(DpSuggestionBox box) {
		suggestionBoxMapper.insert(box);
	}

	/* 
	* @author zhangzj
	* <p>Title: getById</p> 
	* <p>Description: </p> 
	* @param id
	* @return 
	* @see com.api.base.service.ISuggestionBoxService#getById(java.lang.String) 
	* @version V1.0
	*/
	@Override
	public DpSuggestionBox getById(String id) {
		
		return suggestionBoxMapper.getById(id);
	}

	@Override
	public void update(DpSuggestionBox dpSuggestionBox) {
		
		suggestionBoxMapper.update(dpSuggestionBox);
	}

	@Override
	public void delete(String id) {
		
		suggestionBoxMapper.delete(id);
	}

}
